package com.automation.entity;
import com.automation.service.AppiumUtils;
import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.By;

public class ShopPage extends BasePage {
    private final By shopName = By.id("com.dianping.v1:id/tv_shop_name");
    private final By reviewTab = By.xpath("//*[@text='评价']");

    public ShopPage(AndroidDriver driver) {
        super(driver);
    }

    public boolean isPageLoaded() {
        return AppiumUtils.isElementPresent(driver, shopName, 15);
    }

    public void openReviews() {
        click(reviewTab);
    }
}